﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using VisionCloud.Core.Model.Sys;

namespace VisionCloud.Core.Model.Ms
{
    [Table("MsProject")]
    public partial class MsProject : BaseEntity
    {
        public MsProject()
        {
            SysUserProject = new HashSet<SysUserProject>();
        }

        public enum ProjectStatus
        {
            启用 = 0,
            禁用 = 1
        }

        /// <summary>
        /// 项目Id
        /// </summary>
        [Key]
        [Column(TypeName = "uuid")]
        [DatabaseGenerated(DatabaseGeneratedOption.None)]
        public Guid ProjectId { get; set; }

        /// <summary>
        /// 数据中心的映射项目ID
        /// </summary>
        public string MapProjectId { set; get; }

        /// <summary>
        /// 项目名称
        /// </summary>
        [Column(TypeName = "varchar(64)")]
        public string Name { get; set; }

        /// <summary>
        /// 项目描述
        /// </summary>
        [Column(TypeName = "varchar(1024)")]
        public string Description { get; set; }

        /// <summary>
        /// 项目地图坐标
        /// </summary>
        [Column(TypeName = "varchar(32)")]
        public string MapPoint { get; set; }

        /// <summary>
        /// 项目地址
        /// </summary>
        [Column(TypeName = "varchar(128)")]
        public string Address { get; set; }

        /// <summary>
        /// 项目标准
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public string Standard { get; set; }

        /// <summary>
        /// 项目阶段
        /// </summary>
        [Column(TypeName = "varchar(100)")]
        public string Stage { get; set; }

        /// <summary>
        /// 项目状态
        /// </summary>
        [Column(TypeName = "int")]
        public ProjectStatus Status { get; set; }

        /// <summary>
        /// 省
        /// </summary>
        [Column(TypeName = "varchar(60)")]
        public string Province { get; set; }

        /// <summary>
        /// 市
        /// </summary>
        [Column(TypeName = "varchar(60)")]
        public string City { get; set; }

        /// <summary>
        /// 区/镇
        /// </summary>
        [Column(TypeName = "varchar(60)")]
        public string Town { get; set; }

        /// <summary>
        /// 楼栋/层数/交付标准
        /// </summary>
        [Column(TypeName = "text")]
        public string Details { get; set; }

        /// <summary>
        /// 项目编号
        /// </summary>
        [Column(TypeName = "varchar(256)")]
        public string ProjectNo { get; set; }

        [Column(TypeName = "uuid")]
        public Guid CompanyGuid { get; set; }

        [Column(TypeName = "int8")]
        public long ProjectVersion { get; set; }

        [Column(TypeName = "bool")]
        public bool IsPullByClient { get; set; }

        [Column(TypeName = "bool")]
        public bool IsCanPull { get; set; }

        /// <summary>
        /// 发布时，Details中包含的条数
        /// </summary>
        [Column(TypeName = "int2")]
        public int PubliceDetailsCount { get; set; }

        /// <summary>
        /// 发布时间
        /// </summary>
        [Column(TypeName = "timestamp(0)")]
        public DateTime? PubliceDate { get; set; }

        /// <summary>
        /// 施工许可证号
        /// </summary>
        [Column(TypeName = "varchar(20)")]
        public string ConstructionPermitNum { get; set; }

        /// <summary>
        /// 项目经理
        /// </summary>
        [Column(TypeName = "varchar(20)")]
        public string ProjectManager { get; set; }

        /// <summary>
        /// 是否需要提示删除信息,默认不需要，只有删除已发布的项目时，才需要提示
        /// </summary>
        [Required]
        [Column(TypeName = "bool", Order = 999)]
        public bool IsNeedTipDel { get; set; }

        /// <summary>
        /// 区域公司
        /// </summary>
        [Column(TypeName = "varchar(50)")]
        public string RegionalCompany { get; set; }

        public virtual ICollection<SysRole> SysRoles { get; set; }
        public virtual ICollection<MsHouseMap> MsHouseMaps { get; set; }
        public virtual ICollection<SysUserProject> SysUserProject { get; set; }

        public IEnumerable<MsProjectAlgorithm> MsProjectAlgorithms { get; set; }

        /// <summary>
        /// 经度坐标（精确小数点后6位）
        /// </summary>
        public double Longitude { get; set; }
        /// <summary>
        /// 纬度坐标（精确小数点后6位）
        /// </summary>

        public double Latitude { get; set; }
        /// <summary>
        /// 数据源：0：本地，1：FMS同步
        /// </summary>
        public int DataSource { set; get; }

        /// <summary>
        /// FMS项目编码
        /// </summary>
        [Column(TypeName = "varchar(128)")]
        public string fmsProjectCode { get; set; }

        /// <summary>
        /// FMS项目名称
        /// </summary>
        [Column(TypeName = "varchar(256)")]
        public string fmsProjectName { get; set; }

        /// <summary>
        /// 集团项目编码
        /// </summary>
        [Column(TypeName = "varchar(128)")]
        public string bdcProjectCode { get; set; }

        /// <summary>
        /// 集团项目名称
        /// </summary>
        [Column(TypeName = "varchar(256)")]
        public string bdcProjectName { get; set; }

    }
}